#define  _CRT_SECURE_NO_WARNINGS 1
#include "String.h"
using namespace wgl;
using std::cout;
using std::cin;
using std::endl;

void test_string1()
{
	
	string s1;
	string s2 = "abcd";
	string s3 = s2;
	cout << s2 << endl;
}

void test_string2()
{
	string s1 = "abcd";
	s1[1] = 'c';
	cout << s1 << endl;
	string::iterator it = s1.begin();
	//auto it = s1.begin();
	//cout << typeid(it).name();
	while (it != s1.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;
	for (auto ch : s1)
	{
		cout << ch << " ";
	}
	cout << endl;

}

void test_string3()
{
	string s1 = "abcd";
	cout << s1.size() << endl;

	s1.append("  ");
	cout << s1.size() << endl;
	//s1 += "abcg";
	s1.push_back('a');
	cout << s1.size() << endl;

	cout << s1 << endl;
}

void test_string4()
{
	string s1 = "abcd";
	s1.insert(0, 'a');
	s1.insert(0, "axd");
	size_t a = s1.find('a', s1.begin() + 3);

	cout << a << endl;
	cout << s1 << endl;
}

void test_string5()
{
	string s1 = "abcd";
	string s2 = s1.substr(1,2);

	cout << s2 << endl;

	//cin >> s2;
	//cout << s2 << endl;


}

int main()
{
	test_string5();
	return 0;
}